#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
    pid_t pc, pr;
    if ((pc = fork()) < 0)
    {
        printf("error in fork!\n");
        exit(1);
    }
    else if (pc == 0)
    {
        printf("This is child proces with pid of %d \n", getpid());
        sleep(10);
    }
    else
    {
        pr = wait(NULL);
        printf("I catched a child process with pid of %d\n", getpid());
    }
    exit(0);
}